package com.heima.comment.controller;

import com.heima.comment.service.CommentService;
import com.heima.comment.service.RepayCommentService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.mango.dtos.CommentDto;
import com.heima.model.mango.dtos.CommentRepayDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/v1/comment_repay")
@RestController
public class RepayCommentController {
    @Autowired
    private RepayCommentService commentService;

    /**
     *保存回复评论
     * @param dto
     * @return
     */
    @PostMapping("/save")
    public ResponseResult replySave(@RequestBody CommentRepayDto dto){
        return commentService.repaySave(dto);
    }

    /**
     * 查询回复评论
     * @param dto
     * @return
     */
    @PostMapping("/load")
    public ResponseResult loadRepay(@RequestBody CommentRepayDto dto){
        return commentService.loadRepay(dto);
    }

    /**
     * 点赞回复评论
     * @param dto
     * @return
     */
    @PostMapping("/like")
    public ResponseResult likeRepay(@RequestBody CommentRepayDto dto){
        return commentService.likeRepay(dto);
    }
}
